package com.tledu.publisher.controller;

import com.tledu.publisher.service.SendService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/send")
public class ListenerController {
    @Autowired
    private SendService sendService;
    @PostMapping("/msg")
    public String sendEmail(@RequestParam String exchangeName, @RequestParam String message) {
        return sendService.send(exchangeName, message);
    }
}
